import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/pc/home/Home'
import Wu from '@/components/pc/home/Wu'
import Project from '@/components/pc/land/Project'
import Detail from '@/components/pc/land/Detail'
import Detailm from '@/components/pc/detail/Detailm'
import Detaildl from '@/components/pc/detail/Detaildl'
import Detaills from '@/components/pc/detail/Detaills'
import Detailbd from '@/components/pc/detail/Detailbd'
import Pay from '@/components/pc/user/Pay'
import Paydl from '@/components/pc/user/Paydl'
import Paym from '@/components/pc/user/Paym'
import Paydh from '@/components/pc/user/Paydh'
import Paybd from '@/components/pc/user/Paybd'
import Pptf from '@/components/pc/ppt/Pptf'
import Ppts from '@/components/pc/ppt/Ppts'
import Pptt from '@/components/pc/ppt/Pptt'
import Pptm from '@/components/pc/ppt/Pptm'
import Pptl from '@/components/pc/ppt/Pptl'
import Pptc from '@/components/pc/ppt/Pptc'
import Fengxian from '@/components/pc/ppt/Fengxian'
import Useragree from '@/components/pc/user/Useragree'
import Register from '@/components/pc/user/Register'
import Login from '@/components/pc/user/Login'
import Category from '@/components/pc/user/Category'
import Userstaffs from '@/components/pc/user/Userstaffs'
import Userstaffm from '@/components/pc/user/Userstaffm'
import Infoe from '@/components/pc/user/Infoe'
import Datae from '@/components/pc/user/Datae'
import Lande from '@/components/pc/user/Lande'
import Housee from '@/components/pc/user/housee'
import Housep from '@/components/pc/data/Housep'
import Housev from '@/components/pc/data/Housev'
import Meet from '@/components/pc/meet/Meet'
import Yaoqinghan from '@/components/pc/meet/Yaoqinghan'
import Bangdan from '@/components/pc/list/Bangdan'
import Bangdancb from '@/components/pc/list/Bangdancb'
import Bangdancbm from '@/components/pc/list/Bangdancbm'
import Bangdancbs from '@/components/pc/list/Bangdancbs'
import Data from '@/components/pc/data/Data'
import Datadl from '@/components/pc/data/Datadl'
import Loushi from '@/components/pc/data/Loushi'
import Datadh from '@/components/pc/data/Datadh'

Vue.use(Router)

let router = new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    }, {
      path: '/wu',
      name: 'Wu',
      component: Wu
    }, {
      path: '/project',
      name: 'Project',
      component: Project
    }, {
      path: '/detail',
      name: 'Detail',
      component: Detail
    }, {
      path: '/detailm',
      name: 'Detailm',
      component: Detailm
    }, {
      path: '/detaildl',
      name: 'Detaildl',
      component: Detaildl
    }, {
      path: '/detaills',
      name: 'Detaills',
      component: Detaills
    }, {
      path: '/detailbd',
      name: 'Detailbd',
      component: Detailbd
    }, {
      path: '/pay',
      name: 'Pay',
      component: Pay
    }, {
      path: '/paydl',
      name: 'Paydl',
      component: Paydl
    }, {
      path: '/paydh',
      name: 'Paydh',
      component: Paydh
    }, {
      path: '/paym',
      name: 'Paym',
      component: Paym
    }, {
      path: '/paybd',
      name: 'Paybd',
      component: Paybd
    }, {
      path: '/pptf',
      name: 'Pptf',
      component: Pptf
    }, {
      path: '/ppts',
      name: 'Ppts',
      component: Ppts
    }, {
      path: '/pptt',
      name: 'Pptt',
      component: Pptt
    }, {
      path: '/pptm',
      name: 'Pptm',
      component: Pptm
    }, {
      path: '/pptl',
      name: 'Pptl',
      component: Pptl
    },
     {
      path: '/fengxian',
      name: 'Fengxian',
      component: Fengxian
    }, {
      path: '/pptc',
      name: 'Pptc',
      component: Pptc
    }, {
      path: '/useragree',
      name: 'Useragree',
      component: Useragree
    }, {
      path: '/category',
      name: 'Category',
      component: Category
    }, {
      path: '/register',
      name: 'Register',
      component: Register
    }, {
      path: '/login',
      name: 'Login',
      component: Login
    }, {
      path: '/userstaffs',
      name: 'Userstaffs',
      component: Userstaffs
    }, {
      path: '/userstaffm',
      name: 'Userstaffm',
      component: Userstaffm
    }, {
      path: '/housep',
      name: 'Housep',
      component: Housep
    }, {
      path: '/housev',
      name: 'Housev',
      component: Housev
    }, {
      path: '/meet',
      name: 'Meet',
      component: Meet
    }, {
      path: '/yaoqinghan',
      name: 'Yaoqinghan',
      component: Yaoqinghan
    }, {
      path: '/bangdan',
      name: 'Bangdan',
      component: Bangdan
    }, {
      path: '/bangdancb',
      name: 'Bangdancb',
      component: Bangdancb
    }, {
      path: '/bangdancbm',
      name: 'Bangdancbm',
      component: Bangdancbm
    }, {
      path: '/bangdancbs',
      name: 'Bangdancbs',
      component: Bangdancbs
    }, {
      path: '/data',
      name: 'Data',
      component: Data
    }, {
      path: '/datadl',
      name: 'Datadl',
      component: Datadl
    }, {
      path: '/datadh',
      name: 'Datadh',
      component: Datadh
    }, {
      path: '/loushi',
      name: 'Loushi',
      component: Loushi
    }, {
      path: '/infoe',
      name: 'Infoe',
      component: Infoe
    }, {
      path: '/datae',
      name: 'Datae',
      component: Datae
    }, {
      path: '/lande',
      name: 'Lande',
      component: Lande
    }, {
      path: '/housee',
      name: 'Housee',
      component: Housee
    }]
})

/**
 * 判断是否为移动设备，是，则跳转到移动端的路径
 */
router.beforeEach((to, from, next) => {
  if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
    window.location.href = '/m_index.html#/'
    return
  }
  next()
})

export default router
